package red.stu.window.editor.code;

import java.io.Serializable;
import java.util.HashMap;
import java.util.LinkedList;

import javax.swing.text.SimpleAttributeSet;

public class Lexicon implements Serializable {
	
	private HashMap<String, LexiconWord> words;
	
	public Lexicon(HashMap<String, LexiconWord> words) {
		this.words = words;
	}
	
	public HashMap<String, LexiconWord> getWords() {
		return words;
	}

	public void setWords(HashMap<String, LexiconWord> words) {
		this.words = words;
	}
	
	public void putWord(String name, LexiconWord word) {
		words.put(name, word);
	}
	
	public boolean putWordAttr(String name, SimpleAttributeSet attr) {
		LexiconWord w = words.get(name);
		if (w == null)
			return false;
		w.setAttr(attr);
		return true;
	}
	
}
